#Specify the version being used aswell as the language
cmake_minimum_required(VERSION 2.6)

set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Shipping")
#Name your project here
project(LeJeux)

# Add the path to all qt required items. This might be removed in later version
# of cmake. But for now there is no native support
IF("$ENV{BOOST_ROOT}" STREQUAL "")

	message( SEND_ERROR "The environment variable BOOST_ROOT is empty or not set. Please set this to your boost installation directory. This MUST be a compiled boost version!" )

ENDIF("$ENV{BOOST_ROOT}" STREQUAL "")

##############################
# GLOBAL VAR
##############################
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(BUILD_STATIC_LIBS ON)

##############################
# OUTPUT PATHS
##############################
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${CMAKE_SOURCE_DIR}/3rdParty/SDL/SDL2-2.0.1/x86/lib)

##############################
# Find a way to make this cleaner
# 3RD PARTY INCLUDE DIRS
##############################
set(ENGINE_PATH ${CMAKE_SOURCE_DIR}/LeProjects/LeEngine/Code)
set(3RDPARTY_PATH ${CMAKE_SOURCE_DIR}/LeProjects/3rdParty)
set(SDL_INCLUDE_FOLDER ${3RDPARTY_PATH}/SDL/SDL2-2.0.1/include)
set(SDL_LIB_FOLDER ${3RDPARTY_PATH}/SDL/SDL2-2.0.1/lib/x86)
SET(GLM_INCLUDE_PATH ${3RDPARTY_PATH}/GLM/0.9.5.3/glm)

set(BOOST_INCLUDEDIR $ENV{BOOST_ROOT})
set(BOOST_LIBRARYDIR $ENV{BOOST_ROOT}stage/lib)

##############################
# FIND REQUIRED PACKAGES
##############################
set(Boost_USE_STATIC_LIBS   ON)
set(Boost_USE_MULTITHREADED ON)

find_package(Boost 1.55.0 COMPONENTS system filesystem REQUIRED)

##############################
#Find a way to make this cleaner
#3RD PARTY LIB DIRS with cmake support
##############################
add_subdirectory(${3RDPARTY_PATH}/TinyXml)

add_subdirectory(LeProjects/LeJeux/Code/build)
add_subdirectory(LeProjects/WinApp/Code/build)

add_subdirectory(LeProjects/LeEngine/Code/CoreLib/build)
add_subdirectory(LeProjects/LeEngine/Code/Framework/build)
add_subdirectory(LeProjects/LeEngine/Code/GameEngine/build)
add_subdirectory(LeProjects/LeEngine/Code/Renderer/build)

